package com.ten.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ten.common.core.entity.AclRole;
import com.ten.common.core.entity.AclUser;
import com.ten.common.core.vo.Result;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author ：Q大侠
 * @date ：Created in 2022/11/30 19:09
 * @description：
 * @modified By：
 * @version:
 */
public interface AclUserDao extends BaseMapper<AclUser> {
    /** 
     * @create by:  Q大侠
     * @description: 用户管理-禁用/启用 
     * @create time: 2022/12/7 23:57
      * @param id,isDeleted
     * @param id
     * @return  
     */
    @Update(value = "update acl_user set is_deleted=#{isDeleted} where id=#{id}")
    int updateUserStatusByid(String id, Integer isDeleted);

    /** 
     * @create by:  Q大侠
     * @description: 根据用户名修改备注 
     * @create time: 2022/12/9 19:36
      * @param username,nickName
     * @return  
     */
    @Update(value = "update acl_user set nick_name=#{nickName} where username=#{username}")
    int updateUserByUser(String username,String nickName);
    @Update(value = "update acl_user set password=#{newPassword} where id=#{id}")
    int updateUserPassword(String id,String newPassword);
    @Select(value = "select *from acl_user where username=#{username}")
    AclUser selectByName(String username);
}
